package com.lemon.cloud.admin.feign;

import com.lemon.cloud.admin.entity.SysLog;
import com.lemon.cloud.comm.model.ResultMsg;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import static com.lemon.cloud.comm.constants.OAuth2Constant.FROM;

@FeignClient(value = "admin-service", contextId="logFeign")
public interface LogFeign {

    /**
     * 保存日志
     * @param sysLog 日志实体
     * @param from 内部调用标志
     */
    @PostMapping("/log")
    ResultMsg<Boolean> saveLog(@RequestBody SysLog sysLog, @RequestHeader(FROM) String from);

}
